package web.servlet.doctor;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import service.DoctorServiceImpl;
import domain.Doctor;

public class DeleteDoctorByIdServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		// 后取不到数据 //doctorId=51b8a354-f654-4648-8a17-4cf7b07da23e
		String doctorId = request.getParameter("doctorId");
		// 调用业务逻辑
		DoctorServiceImpl ps = new DoctorServiceImpl();
		ps.deleteDoctorById(doctorId);

		request.getRequestDispatcher("/doctor/doctorListServlet").forward(request, response);

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
